Update the internationalization answer. (#340951, Kristof Versant)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 8 May 2006 13:55:24 +0000 (13:55 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 8 May 2006 13:55:24 +0000 (13:55 +0000)
2006-05-08  Matthias Clasen  <mclasen@redhat.com>

* gtk/question_index.sgml (reference): Update the internationalization
answer.  (#340951, Kristof Versant)

docs/reference/ChangeLog
docs/reference/gtk/question_index.sgml

index e8d8a39dc3c765804920cc8abfc13f6affe33840..42d12e2ecc7be649e8ce91549664be16e82e8a2e 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-08  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/question_index.sgml (reference): Update the internationalization
+       answer.  (#340951, Kristof Versant)
+
 2006-05-04  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.9.0 ===
index da2c310fce696fb9cbbe9e4680b244ee301df6a5..771059a357c6a1ddf3938eb6de5a055de23b6e75 100644 (file)
@@ -205,13 +205,15 @@ You eventually have to call gettext() on the string to actually fetch the
 translation.  _() both marks the string for translation and actually translates it.
 </para>
 <para>
+Nowadays, GLib provides the common shorthand macros in the header file
+<filename>gi18n.h</filename>, so you don't have to define them yourself, just
+include that header.
+</para>
+<para>
 Code using these macros ends up looking like this:
 <informalexample>
 <programlisting>
- #include &lt;libintl.h&gt;
-
- #define  _(x)  gettext (x)
- #define N_(x)  x
+ #include &lt;gi18n.h&gt;
 
  static const char *global_variable = N_("Translate this string");
 
@@ -238,6 +240,11 @@ of using the default.For dgettext() the _() macro can be defined as:
 </programlisting>
 </informalexample>
 </para>
+<para>
+Again, GLib comes with the <filename>gi18n-lib.h</filename>, saving you the trouble
+of defining the macros by hand. The macros in that header expect the translation
+domain to be specified by the %GETTEXT_PACKAGE macro. 
+</para>
 </answer>
 </qandaentry>